#include<iostream>
using namespace std;
int f[10010] = { 1 };
int v[110];
int main()
{
	int m, n;
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		cin >> v[i];
	}
	for (int i = 1; i <= n; i++) {
		for (int j = m; j >= v[i]; j--) {
			f[j] += f[j - v[i]];
		}
	}
	cout << f[m] << endl;
	return 0;
}